package com.kotlin.demo

const val PI = 3.14

fun main() {
    when (88) {
        in 0..59 -> println("不及格")
        in 60..80 -> println("normal")
        in 81..90 -> println("良好")
        in 90..100 -> println("优秀")
    }

    var week = 6
    week = 15
    val s = when (week) {
        1 -> "monday"
        2 -> "tuesday"
        3 -> "wednesday"
        4 -> "thursday"
        5 -> "Friday"
        6 -> "saturday"
        7 -> "sunday"
        else -> {
            println("skdlsjdlfj")
        }

    }
    println(s)

    //默认函数
    action01("王五", 33)
    action02("赵六")
    action03()

    //具名函数参数: 参数位置可以改变
    loginAction(username = "zhangsnan", gender = "gender", height = "height", password = "password", age = 34)

    // ` 符号的使用
    登录共而过测试第("张三", password = "123")

}

private fun action01(name: String, age: Int) {
    println("我的名字是$name,我的年龄是$age")
}

private fun action02(name: String, age: Int = 44) {
    println("我的名字是$name,我的年龄是$age")
}

private fun action03(name: String = "李四", age: Int = 18) {
    println("我的名字是$name,我的年龄是$age")
}


private fun loginAction(username: String, password: String, age: Int, gender: String, height: String) {
    println("username:$username password:$password age:$age gender:$gender height$height")
}

private fun `登录共而过测试第`(userName: String, password: String) {
    println("登录通过")
}
